package com.smartcampusbackend.service.impl;

import com.smartcampusbackend.mapper.AnnouncementAttachmentMapper;
import com.smartcampusbackend.model.AnnouncementAttachment;
import com.smartcampusbackend.service.AnnouncementAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnouncementAttachmentServiceImpl implements AnnouncementAttachmentService {
    @Autowired
    private AnnouncementAttachmentMapper announcementAttachmentMapper;

    @Override
    public int addAttachment(AnnouncementAttachment attachment) {
        return announcementAttachmentMapper.insertAttachment(attachment);
    }

    @Override
    public List<AnnouncementAttachment> getAttachmentsByAnnouncementId(Integer announcementId) {
        return announcementAttachmentMapper.selectAttachmentsByAnnouncementId(announcementId);
    }

    @Override
    public int deleteAttachmentsByAnnouncementId(Integer announcementId) {
        return announcementAttachmentMapper.deleteAttachmentsByAnnouncementId(announcementId);
    }
} 